<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>

<body>
    <div id="app">
        <counter></counter>
        <counter></counter>
        <counter></counter>

        <counterpart></counterpart>
    </div>

    <script src="./node_modules/vue/dist/vue.js"></script>
    <script>
        Vue.component("counter", {
            template: '<button v-on:click="count++">你点了我 {{ count }} 次，我记住了.</button>',
            data() {
                return {
                    count: 0
                }
            }
        });

        const counterpart = {
            template: '<button v-on:click="count++">你点了我 {{ count }} 次，我记住了.</button>',
            data() {
                return {
                    count: 0
                }
            }
        };

        var app = new Vue({
            el: '#app',
            data: {
                message: ''
            },
            components: {
                counterpart: counterpart
            }
        });
    </script>
</body>

</html>